#define  _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <assert.h>
char* My_strncpy(char* str1, const char* str2, size_t num)
{
	assert(str1 != NULL);
	assert(str2 != NULL);
	char* p = str1;
	while (num--)
	{
		if (*str2 != '\0')
		{
			*str1++ = *str2++;
		}
		else
		{
			*str1++ = '\0';
		}
	}
	return p;
}
int main()
{
	char a[20] = "acdfsdfghfds";
	char a1[] = "lsbjg";
	printf("%s\n", My_strncpy(a, a1, 6));

	return 0;
}